﻿using System;
using System.Data;
using SapaFinance.Domain.Model;
using SapaFinance.Infrastructure.CBRFService;

namespace SapaFinance.Infrastructure.Repository
{
    public class CurrencyExchangerCBRF : ICurrencyExchanger
    {
        public DailyInfoSoap SoapClient { get; private set; }

        public CurrencyExchangerCBRF(DailyInfoSoap soapClient)
        {
            SoapClient = soapClient;
        }
        //private  decimal t(Currency to, DateTime dateTime)
        //{
        //    var dataSet = SoapClient.GetCursOnDate(dateTime);
        //    foreach (DataRow row in dataSet.Tables["ValuteCursDynamic"].Rows)
        //    {
        //        switch (row["VchCode"].ToString())
        //        {
        //            case to.Name:
        //                var z = Decimal.Parse(row["Vcurs"].ToString());


        //                break;
        //            case "EUR":
        //                var zx2 = Decimal.Parse(row["Vcurs"].ToString());

        //                break;

        //        }
        //    }
        //}
        public Money Reduce(Money money, Currency currencyTo, DateTime dateTime)
        {
        //    var result = t(currencyTo, dateTime);
            return Money.Create(0m, currencyTo);
        }  
    }
}